﻿using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.JSON;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RK.WebApi.Dz
{
    [Description("Dz:webapiTest"), HotUpdate]
    public class TestWebApi : AbstractDynamicFormPlugIn
    {
        public override void OnBeforeWebApiOperation(AfterWebApiOperationArgs e)
        {
            base.OnBeforeWebApiOperation(e);
            var operationNumber = e.WebContext.FormOperation.Operation;
            var opName = e.WebContext.FormOperation.OperationName.Where(s => s.Key == 2052).FirstOrDefault().Value;
            var opName2 = e.WebContext.FormOperation.OperationName.Select(s => s.Value).First();
            var val = JSONObject.Parse(e.WebContext.RequestDTO.ToString());
            string flags = "";
            if (val.ContainsKey("InterationFlags"))
            {
                flags = val["InterationFlags"].ToString();
            }
        }
        public override void OnAfterWebApiOperation(AfterWebApiOperationArgs e)
        {
            base.OnAfterWebApiOperation(e);
            var operationNumber = e.WebContext.FormOperation.Operation;
            var opName = e.WebContext.FormOperation.OperationName.Where(s => s.Key == 2052).FirstOrDefault().Value;
            var opName2 = e.WebContext.FormOperation.OperationName.Select(s => s.Value).First();
            var val = JSONObject.Parse(e.WebContext.RequestDTO.ToString());
            string flags = "";
            if (val.ContainsKey("InterationFlags"))
            {
                flags = val["InterationFlags"].ToString();
            }
        }
    }
}
